package com.hziee.cosmanage.search.controller;

import com.hziee.common.utils.R;
import com.hziee.cosmanage.search.service.SearchService;
import com.hziee.cosmanage.search.vo.SearchParam;
import com.hziee.cosmanage.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RequestMapping("search")
@RestController
public class InviteSearchController {

    @Autowired
    SearchService searchService;

    /**
     * 有值查询
     * @param searchParam
     * @return
     * @throws IOException
     */
    @PostMapping("/search")
    public R search(@RequestBody SearchParam searchParam) throws IOException {
        SearchResult response = searchService.search(searchParam);
        return R.ok().put("data",response);
    }
}
